'''
@author: Nati 
'''
from clasesPrincipales.PCB import PCB
from mockito import mock, when
import unittest

class TestPCB (unittest.TestCase):
    def setUp (self):
        myProgram = mock()
        self.pcb = PCB (myProgram, 4)
    
    def tearDown(self):
        self.pcb = None
    
    def testAumentarInstruction(self):
        self.setUp()
        #confirmo que antes el valor era 0, para luego aumentar la instruccion
        self.assertEquals(self.pcb.getCurrentInstruction(), 0)
        self.pcb.aumentarInstruction()
        self.assertEquals(self.pcb.getCurrentInstruction(), 1)
        self.tearDown()
    
    def testLenInstructions (self):
        myProgram = mock()
        when(myProgram).xx().thenReturn("hello")
        myProgram.xx()
        
#        when (myProgram).lenCodigo().thenReturn(5)
#        tmnio = myProgram.lenCodigo()
#        self.assertTrue(tmnio, 5)
#        memoria_mock = mock()
#        when(memoria_mock).intNumero(10).thenReturn(5)     
#        x = memoria_mock.intNumero(10)
        
